/* stylelint-disable */

@import "../../styles/prism-theme.less";
@import "../../styles/prism-theme-dark.less";

.TDesign-doc-demo {
  margin: 24px 0 48px;
  background-color: var(--bg-color-demo);
  color: var(--text-primary);
  border: 1px solid var(--component-border);
  border-radius: 6px;

  &.open {
    background: var(--bg-color-code);

    .TDesign-doc-demo__footer {
      border-radius: 6px;
    }

    .TDesign-doc-demo__btns {
      position: relative;

      &::after {
        content: "";
        width: 100%;
        height: 20px;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1;
        background: var(--bg-color-code-linear);
      }

      .action:hover {
        background-color: var(--bg-color-component-hover);
      }
    }

  }

  &__footer {
    border-radius: 0 0 5px 5px;
  }

  &__btns {
    height: 48px;
    padding: 8px;
    display: flex;
    justify-content: flex-end;
    column-gap: 8px;
    align-items: center;
    box-sizing: border-box;

    .action {
      height: 32px;
      width: 32px;
      padding: 8px;
      box-sizing: border-box;
      border-radius: var(--border-radius);
      cursor: pointer;
      user-select: none;
      transition: all .1s;
      display: inline-flex;
      color: var(--text-secondary);

      &:hover {
        color: var(--text-primary);
        background-color: var(--bg-color-demo-hover);
      }

      &.active {
        color: var(--text-primary);
        background-color: var(--bg-color-demo-select);
      }
    }
  }

  &__code {
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    max-height: 560px;

    pre {
      margin: 0;
      padding: 20px 24px 36px 24px;
      max-height: 560px;
      box-sizing: border-box;
      overflow: auto;
      background: var(--bg-color-code);
      color: var(--text-primary);
      border-top: 1px solid var(--component-border);

      &:hover {
        &::-webkit-scrollbar-thumb {
          background-color: var(--bg-color-scroll);
        }
      }
    
      &::-webkit-scrollbar {
        width: 12px;
        height: 12px;
        background: transparent;
      }

      &::-webkit-scrollbar-corner {
        width: 0;
      }
    
      &::-webkit-scrollbar-thumb {
        border-radius: 6px;
        border: 4px solid transparent;
        background-clip: content-box;
        background-color: transparent;
      }
    }
  }
}

.TDesign-doc-demo-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--block-base-width) * 3);
  box-sizing: border-box;
  cursor: pointer;
  border-top: 1px solid var(--component-border);
  padding: 4px 0;
  position: relative;

  &__active {
    height: 2px;
    width: 180px;
    background-color: var(--text-interactive);
    position: absolute;
    left: 0;
    bottom: 1px;
    transition: all var(--anim-time-fn-easing) var(--anim-duration-moderate);
  }

  &__item + &__item {
    margin-left: 8px;
  }

  &__item {
    margin: 4px;
    width: 188px;
    text-align: center;
    padding: 4px 0;
    font-size: var(--block-base-width);
    box-sizing: border-box;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    word-break: keep-all;
    white-space: nowrap;
    transition: background .2s;

    &:hover,
    &.active {
      color: var(--text-interactive);

    }

    &:hover {
      background: var(--bg-color-demo-hover);
    }

  }

}